<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/jquery.validate.js" type = "text/javascript"></script>
	<script src = "../js/messages_zh.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	
	<link href="<%=request.getContextPath() %>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath() %>/css/global.css" rel="stylesheet" type="text/css" />
	<title></title>
	<style>
		#AddUserForm label.error {
			margin-left: 10px;
			width: auto;
			color:red;
			display: inline;
		}
	</style>
</head>
<script>
$(function() {
//增加/修改
	$("#btnadd").click(function() {
		var course_name = $("#COURSE_NAME").val();
		var stu_id = $("#STU_ID").val();
		var revise_scores = $("#REVISE_SCORES").val();
		
	    if(revise_scores==null || revise_scores=="" || revise_scores==''){
	        alert("修正成绩不可为空！");
	        return false;
	    }else{
	        $.ajax({
	            type : "post",
	            dataType : "text",
	            url : "test?ActionType=test_Update",
	            data : $("#AddScoreForm").serialize(),
	            success : function(massage) {
	                if (massage == 'success') {
	                	//goTo("test?ActionType=test_ViewInit");
	                	alter("修改成功！");
	                }
	                if (massage == 'fail') {
	                	alert("修改失败！");
	                }
	            }
	        });
	    }
	 });

    //返回
    $("#btnreturn").click(function() {
    	goTo("test?ActionType=test_ViewInit");
    });
	});
	 
        </script>


<body>
    <c:choose>
	    <c:when test="${CONDITIONMAP.FLAG == 'add'}">
   			<div id="current">当前位置：考试分析  &gt; 考试成绩  &gt; 新建学生成绩</div>
	    </c:when>
	    <c:when test="${CONDITIONMAP.FLAG == 'update'}">
   			<div id="current">当前位置：考试成绩管理：成绩修改</div>
	    </c:when>
	   
    </c:choose>
  
    <form id="AddScoreForm" name="AddScoreForm" method="post">
        <table width="500" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30" align="center" class="xxpage">
                	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                       <tr>
						          <td width="14%" class="xxpage_td2">考试科目：</td>
						        <td width="86%" class="xxpage_td2">
                              	<input name="COURSE_NAME" id="COURSE_NAME" type="text" 
                              	<c:if test="${CONDITIONMAP.FLAG == 'update'}" > readonly = 'readonly' </c:if>
                              	 value="<c:out value="${TESTINFO1.course_name}"/>"/>
						        <input type="hidden" name="FLAG" value="<c:out value="${CONDITIONMAP.FLAG}"/>" />
                            	</td>  
                        </tr>
                       
                        <tr>
                            <td class="xxpage_td2">学生学号：</td>
                            <td class="xxpage_td2">
                            <input name="STU_ID" id="STU_ID" type="text"  
                            <c:if test="${CONDITIONMAP.FLAG == 'update'}" > readonly = 'readonly' </c:if>
                            value="${TESTINFO1.student_id}"  />
                             <input type="hidden" name="FLAG" value="<c:out value="${CONDITIONMAP.flag}"/>" />   
                           </td>
                        </tr>
                    	<tr>
                            <td class="xxpage_td2">学生姓名：</td>
                            <td class="xxpage_td2">
                            <input name="STU_NAME" id="STU_NAME" type="text"  
                            <c:if test="${CONDITIONMAP.FLAG == 'update'}" > readonly = 'readonly' </c:if>
                            value="${TESTINFO1.student_name}"  />
                             <input type="hidden" name="FLAG" value="<c:out value="${CONDITIONMAP.flag}"/>" />   
                           </td>
                        </tr>
                        <tr>
                            <td class="xxpage_td2">修正成绩：</td>
                            <td width="86%" class="xxpage_td2">
                              <input name="REVISE_SCORES" id="REVISE_SCORES" type="text" value="<c:out value="${TESTINFO1.revise_scores }"/>"/>
                            </td>
                        </tr>
                    </table>
                 </td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="49%" height="40" align="right"><input id="btnadd" name="btnadd" type="submit" class="btn_2" value="确认" /></td>
                <td width="2%" align="center">&nbsp;</td>
                <td align="left"><input id="btnreturn" name="btnreturn" type="button" class="btn_2" value="返回" /></td>
            </tr>
        </table>
        </form>

</body>
</html>